﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Niknak.Services.ServiceCore.TaskScheduler
{
    /// <summary>
    /// Defines that config classes for scheduled tasks must contain certain criteria for the task to start
    /// </summary>
    public interface IAdvancedTaskConfig
    {
        /// <summary>
        /// The date on which the schedule should start. Format is yyyy-MM-dd.
        /// </summary>
        string StartDate { get; }
        /// <summary>
        /// The date on which the schedule should end. Format is yyyy-MM-dd.
        /// </summary>
        string EndDate { get; }

        /// <summary>
        /// Flags enum that lists the days on which task iterations are allowed to run (including Daily).
        /// </summary>
        InternalEnums.TaskScheduler.DaysOfWeek RunOnDays { get; }

        /// <summary>
        /// The UTC time at which the schedule should start. Format is HH:mm:ss.
        /// </summary>
        string StartTime { get; }
        /// <summary>
        /// The UTC time at which the schedule should end. Format is HH:mm:ss. Optional.
        /// </summary>
        string EndTime { get; }
        /// <summary>
        /// Allows for a long-running dumb task to be automatically terminated at its EndTime
        /// </summary>
        bool TerminateAtEndTime { get; }

        /// <summary>
        /// The type of interval for this task.
        /// </summary>
        InternalEnums.TaskScheduler.IntervalType IntervalType { get; }
        /// <summary>
        /// A custom length of time between each iteration of the task. Format is d.HH:mm:ss. No more than 49 days.
        /// </summary>
        string CustomInterval { get; }

        /// <summary>
        /// The number of seconds a task iteration start time is allowed to drift either side of the calculated iteration schedule. Typically +/- just a few seconds, proportional to the Interval value.
        /// </summary>
        int AllowableDrift { get; }
    }
}
